﻿using System.Windows;
using DragEventArgs = ChessKit.Ui.DragEventArgs;

namespace DragDropTestStand
{
  /// <summary>
  /// Interaction logic for MainWindow.xaml
  /// </summary>
  public partial class MainWindow : Window
  {
    public MainWindow()
    {
      InitializeComponent();
    }

    private void Grid_Drag(object sender, DragEventArgs e)
    {
      var element = ((FrameworkElement)e.OriginalSource);
      _grid.Children.Remove(element);
      e.FailToDrop = () => _grid.Children.Add(element);
    }

    private void Grid_Drop(object sender, RoutedEventArgs e)
    {
      var dropTarget = (FrameworkElement)e.OriginalSource;
      if (dropTarget == _rect)
      {
        MessageBox.Show("Wow!");
      }
    }
  }
}
